import request from '@/utils/request'

// 查询售后列表
export function listRefund(query) {
  return request({
    url: '/sales/refund/list',
    method: 'post',
    data: query
  })
}

// 查询售后详细
export function getRefund(id) {
  return request({
    url: '/sales/refund/' + id,
    method: 'get'
  })
}

// 新增售后
export function addRefund(data) {
  return request({
    url: '/sales/refund/add',
    method: 'post',
    data: data
  })
}

// 修改售后
export function updateRefund(data) {
  return request({
    url: '/sales/refund/update',
    method: 'post',
    data: data
  })
}

// 删除售后
export function delRefund(id) {
  return request({
    url: '/sales/refund/delete/' + id,
    method: 'post'
  })
}
// 审核
export function auditRefund(id) {
  return request({
    url: '/sales/refund/audit/' + id,
    method: 'post'
  })
}
// 审核撤销
export function auditCancel(id) {
  return request({
    url: '/sales/refund/auditCancel/' + id,
    method: 'post'
  })
}
// 退款
export function drawback(id) {
  return request({
    url: '/sales/refund/drawback/' + id,
    method: 'post'
  })
}
// 退款
export function cancelRefund(id) {
  return request({
    url: '/sales/refund/cancelRefund/' + id,
    method: 'post'
  })
}

// 查询销售订单状态统计信息
export function findRefundStatusCount(query) {
  return request({
    url: '/sales/refund/findRefundStatusCount',
    method: 'post',
    data: query
  })
}


// 根据id列表获取订单信息
export function getSalesOrderByIds(ids,processMode) {
  return request({
    url: '/sales/refund/getSalesOrderByIds?ids='+ ids +'&processMode=' + processMode,
    method: 'post'
  })
}

// 批量新增售后
export function addRefundBatch(data) {
  return request({
    url: '/sales/refund/addRefundBatch',
    method: 'post',
    data: data
  })
}